<?
	function addIllustration($id_art, $legende, $url, $table, $colonne) {
		$result = mysql_query("INSERT INTO illustrations(`url`, `legende`) VALUES('$url', '$legende')");
		
		if (!$result) {
	   		die('Requ�te invalide 1 : ' . mysql_error());
		}
		
		$result = mysql_query("SELECT id FROM illustrations WHERE `url`='$url' AND `legende`='$legende'");
		
		if (!$result) {
	   		die('Requ�te invalide 2 : ' . mysql_error());
		}
		
		$id_ill = mysql_result($result,0,"id");
		$result = mysql_query("INSERT INTO $table($colonne, `id_illustre`) VALUES('$id_art', '$id_ill')");
		
		if (!$result) {
	   		die('Requ�te invalide 3 : ' . mysql_error());
		}
	}
	
	function supIllustration($id_ill, $table) {
		$result = mysql_query("DELETE FROM $table WHERE id='$id_ill'");
		
		if (!$result) {
	   		die('Requ�te invalide : ' . mysql_error());
		}
	}
	
	function addIllustrationExistante($id_art,$id_ill, $table, $colonne) {
		$result = mysql_query("INSERT INTO $table($colonne, `id_illustre`) VALUES('$id_art', '$id_ill')");
		
		if (!$result) {
	   		die('Requ�te invalide : ' . mysql_error());
		}
	}
?>